package concurrent;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.ArrayBlockingQueue;

/**
 * @author Summerday
 */
public class TestArrayBlockingQueue {

    public static void main (String[] args) {

        List<Integer> nums = new ArrayList<>();
        for (int i = 0; i < 5; i++) nums.add(i);
        ArrayBlockingQueue<Integer> queue = new ArrayBlockingQueue<>(10, false, nums);
        Iterator<Integer> iterator = queue.iterator();
        while(iterator.hasNext()){
            System.out.println(iterator.next());
        }

    }
}
